<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

    <form action="/ajax" method="get">
        <input type="text" name = "name">
        <input type="text" sex = "sex">
        <input type="submit" value="提交" onclick="send()">

    </form>

</body>

<script src="https://code.jquery.com/jquery-3.3.1.min.js" crossorigin="anonymous"></script>
<script>
    function send() {
        $.post(
            "/ajax",
            {"name":"张三","age":21},//请求后面带的参数

            function (data) {
                console.log(typeof(data));
                console.log(data);
            }

        )


    }

</script>

</html>